import 'dart:convert';

import 'package:flutter/cupertino.dart';

import 'base_handler.dart';

class DeviceSizeHandler extends BaseHandler {

  @override
  String name = "deviceSize";

  @override
  void handler(dynamic data, dynamic responseCallback) async {
    double screenWidth = MediaQuery.of(context).size.width;
    double screenHeight = MediaQuery.of(context).size.height;
    final statusBarHeight = MediaQuery.of(context).padding.top;
    final navigationBarHeight = MediaQuery.of(context).padding.bottom;
    responseCallback(jsonEncode({
      "screenWidth": screenWidth,
      "screenHeight": screenHeight,
      "statusBarHeight": statusBarHeight,
      "navigationBarHeight": navigationBarHeight
    }));

  }
}